Hệ thống quản lý trường đại học bằng PHP

1 <?php
2 require_once(
'includes/config.php');
3 if
( $user->is_logged_in() ){ header('Location: index.php'); }
4 ?>
5 <!DOCTYPE html>
6 <html >
7 <head>
8     <meta charset=
"UTF-8">
9     <title>Login screen</title>
10     <link rel=
"stylesheet" href="login/style.css">
11 </head>
12
13 <body>
14
15     <div
class="login-page">
16         <div
class="form">
17             <?php
18             
if(isset($_POST['submit'])){
19
20                 $username = trim($_POST[
'username']);
21                 $password = trim($_POST[
'password']);
22
23                 
if($user->login($username,$password)){
24                     header(
"Location: " . $_SERVER["HTTP_REFERER"]);
25                     exit;
26                 }
else {
27                     $message =
'<p class="error">Wrong username or password</p>';
28                 }
29
30             }
31
32             
if(isset($message)){ echo $message; }
33             ?>
34             <form
class="register-form" action="register.php" method="post">
35                 <input type=
"text" placeholder="Account Name" name="accname" />
36                 <input type=
"password" placeholder="password" name="passwd" />
37                 <input type=
"text" placeholder="email" name="mail" />
38                 <input type=
"text" placeholder="student card" name="studcard" />
39                 <input type=
"text" placeholder="CIN" name="cin" />
40                 <button type=
"submit" name="submit">create</button>
41                 <p
class="message">Already registered? <a href="#">Sign In</a></p>
42             </form>
43             <form
class="login-form" action="" method="post">
44                 <input type=
"text" name="username" placeholder="username"/>
45                 <input type=
"password" name="password" placeholder="password"/>
46                 <button type=
"submit" name="submit" value="Login">login</button>
47                 <p
class="message">Not registered? <a href="#">Create an account</a></p>
48             </form>
49         </div>
50     </div>
51     <script src=
'http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
52     <script src=
"login/index.js"></script>
53
54 </body>
55 </html>


Gõ tìm kiếm nhanh...